<template>
	<view class="content" @click="gotodemo2">
		跳转到demo1
	</view>
	<view class="content" @click="gotoback">
		返回demo页
	</view>
</template>

<script setup>

function gotodemo2(){
	uni.navigateTo({
		url:"/pages/demo/demo?id=10&age=18",
		success:(e)=>{
			console.log(e);
		}
	})
}

function gotoback(){
	let delta = getCurrentPages().map(item=>item.route).findIndex(item=>item=="pages/demo/demo");
	uni.navigateBack({
		delta
	})
}

onLoad((e)=>{
	console.log(e);
})
console.log(getCurrentPages());
</script>

<style lang="scss">
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
</style>
